From: Tim Deegan Date: Thu, 30 Jun 2011 09:26:54 +0000 (+0100) Subject: Nested p2m: remove bogus check of CR3 value. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10095 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=3812cf76563539d04e0c50101dca043331802a43;p=xen.git Nested p2m: remove bogus check of CR3 value. 0 is a valid CR3 value; CR3_EADDR isn't but there's nothing stopping a guest from putting it in its VMCB. The special case was broken anyway since AFAICT "p2m->cr3" is a nester-cr3 (i.e. p2m-table) value and guest_cr[3] is an actual-cr3 (pagetable) value. Signed-off-by: Tim Deegan Acked-by: Christoph Egger --- diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index f6f9874c51..20763b09bb 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -1122,8 +1122,8 @@ p2m_get_nestedp2m(struct vcpu *v, uint64_t cr3) struct p2m_domain *p2m; int i; - if (cr3 == 0 || cr3 == CR3_EADDR) - cr3 = v->arch.hvm_vcpu.guest_cr[3]; + /* Mask out low bits; this avoids collisions with CR3_EADDR */ + cr3 &= ~(0xfffull); if (nv->nv_flushp2m && nv->nv_p2m) { nv->nv_p2m = NULL;